﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Universum.Model.Domain.QuestionIT;

namespace Universum.Model.Services.QuestionIt
{
	public interface IQuestionService
	{
		/// <summary>
		/// Gets the number of questions
		/// </summary>
		/// <returns></returns>
		int GetQuestionsCount();

		/// <summary>
		/// Gets a paged view of questions
		/// </summary>
		/// <param name="pageIndex">The 0 starting index of the question</param>
		/// <param name="pageSize">The number of questions to display on a page</param>
		/// <returns>A list of questions</returns>
		IList<Universum.Model.Domain.QuestionIT.Question> GetQuestionsFor(int pageIndex, int pageSize);

		/// <summary>
		/// Returns a new question
		/// </summary>
		/// <returns>A new questio</returns>
		Universum.Model.Domain.QuestionIT.Question CreateQuestion();

		void SaveOrUpdate(Universum.Model.Domain.QuestionIT.Question save);

		Universum.Model.Domain.QuestionIT.Question GetQuestionById(Guid guid);

		Universum.Model.Domain.QuestionIT.Question GetQuestionBySlug(string id);

		IList<Universum.Model.Domain.QuestionIT.QuestionReply> GetRepliesFor(Guid guid);

		Universum.Model.Domain.QuestionIT.QuestionReply GetNewReplyFor(Guid guid);

		void SaveOrUpdateReply(Universum.Model.Domain.QuestionIT.QuestionReply reply);

		QuestionReply GetQuestionReplyById(Guid id);

		void RemoveQuestionReply(QuestionReply questionReply);

		void RemoveQuestion(Question question);

		void MarkQuestionAsOffensive(Question question, string byUsername);

		void UnMarkQuestionAsOffensive(Question question, string byUsername);

		void UnMarkQuestionReplyAsOffensive(QuestionReply reply);

		void MarkQuestionReplyAsOffensive(QuestionReply reply);

		void MarkQuestionAsAnswered(Question question);

		void MarkQuestionReplyAsAnswer(QuestionReply reply);

		void UnMarkQuestionAsAnswered(Question question);

		void UnMarkQuestionReplyAsAnswer(QuestionReply reply);

		void PlusRatingOnQuestion(Guid id, string byUsername);

		void MinusRatingOnQuestion(Guid id, string byUsername);

		IList<Question> GetUnansweredQuestions(int startIndex, int questionsPerPage);

		IList<Question> GetHottestQuestions(int startIndex, int questionsPerPage);

		IList<Question> GetAnsweredQuestions(int startIndex, int questionsPerPage);

		IList<Question> GetOffensiveQuestionsFor(int startIndex, int questionsPerPage);

		void UnMarkQuestionAsOffensiveBySuperUser(Guid id);
	}
}
